projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddf8a68
)
Tweak EXIF reader to allow reads below sea level.
author
robertlipe
<robertlipe@gmail.com>
Wed, 22 Aug 2012 03:02:12 +0000
(
03:02
+0000)
committer
robertlipe
<robertlipe@gmail.com>
Wed, 22 Aug 2012 03:02:12 +0000
(
03:02
+0000)
gpsbabel/exif.c
patch
|
blob
|
history
diff --git
a/gpsbabel/exif.c
b/gpsbabel/exif.c
index 2876d4c4d3013a837f102eaf7f5b66c7aebda944..ae9640563e8bae5ff81f215801fb08d26d170b3f 100644
(file)
--- a/
gpsbabel/exif.c
+++ b/
gpsbabel/exif.c
@@
-779,10
+779,21
@@
exif_waypt_from_exif_app(exif_app_t* app)
}
if (alt != unknown_alt) {
- if (alt_ref != 0) {
+ double sign;
+ switch (alt_ref != 0) {
+ case 0:
+ sign = 1.0;
+ break;
+
+ case 1:
+ sign = -1.0;
+ break;
+
+ default:
warning(MYNAME ": Invalid GPSAltitudeRef (%d)! Using 0 (= Sea level).\n", alt_ref);
+ sign = 1.0;
}
- wpt->altitude = alt;
+ wpt->altitude =
sign *
alt;
#ifdef EXIF_DBG
printf(MYNAME "-GPSAltitude = %12.7f m\n", wpt->altitude);
#endif